﻿using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;

namespace Qy.Core
{
    public class ApplicationContext
    {

        public ApplicationContext(IHttpContextAccessor httpContextAccessor)
        {
            HttpContextAccessor = httpContextAccessor;
        }

        public IHttpContextAccessor HttpContextAccessor { get; }

        public ICacheManager ICacheManager
        {
            get
            {
                return HttpContextAccessor.HttpContext.RequestServices.GetService<ICacheManager>();
            }
        }
        public ILoginUserInfoMethods ILoginUserInfoMethods
        {
            get
            {
                return HttpContextAccessor.HttpContext.RequestServices.GetService<ILoginUserInfoMethods>();
            }
        }
    }
}
